package com.coderman.domainservice.member.app.consumer;

import com.alibaba.fastjson.JSON;
import com.coderman.domainservice.blogtopic.domain.model.entity.BlogAggregateBO;
import com.coderman.domainservice.blogtopic.domain.model.event.consumer.BlogCheckResultEvent;
import com.coderman.domainservice.blogtopic.domain.model.valueobject.BlogStatusEnum;
import com.coderman.domainservice.blogtopic.infrast.mq.Constants;
import com.coderman.domainservice.blogtopic.infrast.mq.provider.MqSendService;
import com.coderman.domainservice.member.domain.gataway.IndicesStatisticsService;
import com.coderman.domainservice.member.domain.model.user.event.consumer.PublishBlogEvent;
import com.coderman.domainservice.member.domain.model.user.valueobject.IndiceEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * Description:
 * date: 2021/3/31
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 * 消费博客发布事件
 */
@Service
public class BlogPublishConsumerService {
    @Autowired
    private IndicesStatisticsService indicesStatisticsService;
    /**
     * 消费博客发布结果消息
     * @param publishBlogEvent
     */
    public void dealMessage(PublishBlogEvent publishBlogEvent){
        indicesStatisticsService.updateIndicesStatistics(IndiceEnum.BLOG_COUNT,publishBlogEvent.getUserId(),true);
    }
}
